cmake_minimum_required (VERSION 3.12)
set(PROJ "example")
project(${PROJ})

set(CMAKE_CXX_STANDARD 20)

FILE (GLOB ALL_SOURCES "*.cpp" "*.c" "*.h" )

message(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)

#指定自己的python库路径
link_directories(D:/cext/Python310/libs)
#将自己的python头文件包含进来
INCLUDE_DIRECTORIES(D:/cext/Python310/include)
#将自己pybind11头文件路径包含进来
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
#连接到两个动态库文件
link_libraries(D:/cext/Python310/libs/python310.lib)

set(PROJECT_SOURCES ${ALL_SOURCES})

#add_executable(pf_test  ${PROJECT_SOURCES})
add_library(${PROJ} SHARED ${PROJECT_SOURCES})


SET_TARGET_PROPERTIES (${PROJ} PROPERTIES OUTPUT_NAME ${PROJ} SUFFIX ".pyd")